propsage.namespace('modules.tickets.public');

modules.tickets.public.open = (function($, ui) {
	function onTicketTypeChange(e) {
		var type = $(this).val();
		var referenceLabel = false;
		
		switch (type) {
			case 'Agency':
				break;
			case 'Agent':
				referenceLabel = 'CEA License No.';
				break;
			case 'Transaction':
				referenceLabel = 'Transaction No.';
				break;
		}
		
		if (referenceLabel == false) {
			$('.ticket-reference').hide();
		} else {
			$('.ticket-reference').show();
			$('label[for="Ticket_reference"]').text(referenceLabel);
		}
	}
	
	$(document).ready(function() {
		$('#Ticket_type').on('change', onTicketTypeChange);
	});
})(jQuery, propsage.ui);